package com.srit.migration.business.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

import com.srit.base.bean.Page;
import com.srit.base.dao.SqlMapDao;
import com.srit.migration.business.bean.VirtualDb;
import com.srit.migration.business.dao.VirtualDbDao;

/**
 * @author guan
 * @by daoImpl.tem
 * 
 */
 @Service
public class VirtualDbDaoImpl implements VirtualDbDao {
	@Autowired(required = true)
	private SqlMapDao sqlMapDao;

	@Override
	public void save(VirtualDb virtualDb) {
		sqlMapDao.save("VirtualDb.save", virtualDb);
	}

	@Override
	public void update(VirtualDb virtualDb) {
		sqlMapDao.update("VirtualDb.save", virtualDb);
	}

	@Override
	public VirtualDb getById(VirtualDb virtualDb) {
		return (VirtualDb) sqlMapDao.getById("VirtualDb.getById", virtualDb.getId());
	}

	@Override
	public void delete(VirtualDb virtualDb) {
		sqlMapDao.delete("VirtualDb.delete", virtualDb);
	}

	@Override
	public void page(Page page) {
		sqlMapDao.queryForObject("VirtualDb.page", page);
	}
	
	@Override
	public void batchSave(List<VirtualDb> virtualDbList) {
		sqlMapDao.batchSave("VirtualDb.batchSave", virtualDbList);

	}

	@Override
	public List list(Page page) {
		return sqlMapDao.queryForList("VirtualDb.list", page);

	}

}
